import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
import vueJsx from '@vitejs/plugin-vue-jsx'

// https://vitejs.dev/config/
export default defineConfig({
    css: {
        preprocessorOptions: {
            less: {
                additionalData: `
                @import "@/assets/styles/variables.less";
                @import "@/assets/styles/mixins.less";
            `,
            },
        },
    },
    plugins: [vue(), vueSetupExtend(), vueJsx()],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src'),
        },
    },
    // 配置开发服务器
    server: {
        // QQ 三方登录的回调uri为：http://www.corho.com:8080/#/login/callback
        // vite 中配置：www.corho.com:8080
        host: 'www.corho.com',
        port: 8080,
        // open: true,
        // cors: true, // 允许开发时 AJAX 跨域
    },
})
